﻿using Application;
using Application.Services;

namespace Web.Infrastructure.Core.RoleProviders
{
    public class SimpleRoleProvider : RoleProviderBase
    {
        public override string[] GetRolesForUser(string username)
        {
            var accountService = AppEngine.Container.GetInstance<IAccountService>();
            return accountService.GetRolesForUser(username);
        }

        public override bool IsUserInRole(string username, string roleName)
        {
            var accountService = AppEngine.Container.GetInstance<IAccountService>();
            return accountService.IsUserInRole(username, roleName);
        }
    }
}